<?php /* Smarty version 2.6.14, created on 2015-04-15 13:33:21
         compiled from order_right.index.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'date_format', 'order_right.index.html', 164, false),)), $this); ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "header.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<!--<dl class="adminoption">
  <dt></dt>
  <dd><a href="/order_exception/index/"><?php echo $this->_tpl_vars['systemLang']['errorOrder']; ?>
</a></dd>
  <dd><a href="/order_right/"><?php echo $this->_tpl_vars['systemLang']['successOrder']; ?>
</a></dd>
</dl>-->

<form action="<?php echo $this->_tpl_vars['formAction']; ?>
" method="POST" <?php if ($this->_tpl_vars['is_validator']): ?> id="adminform" onsubmit="return Validator.Validate(this)" <?php endif; ?>>
<link rel="stylesheet" type="text/css" href="<?php echo @BASEURI; ?>
public/css/ui.datepicker.css"/>
<script language="javascript" src="<?php echo @BASEURI; ?>
public/js/jquery.autocomplete.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo @BASEURI; ?>
public/css/jquery.autocomplete.css"/>
<style type="text/css">
table div{
	float:left;
	margin:3px auto 6px auto;
	padding:0px;
}
#search tr{
	line-height:120%;
	margin:0px;
	padding:0px;
}

select{
    height:23px;
}
</style>
<script language="javascript" src="<?php echo @BASEURI; ?>
public/js/ui.datetimepicker.js"></script>
<script language="javascript" type="text/javascript">
var server		=	'<?php echo $this->_tpl_vars['servers_json']; ?>
';  // 服务器信息数组
var platform 	= 'p_<?php echo $this->_tpl_vars['search']['sfrom']; ?>
';      // 当前选中平台
var gcode 		= 'g_<?php echo $this->_tpl_vars['search']['game_id']; ?>
';      // 当前选中游戏
var sel_server	= "<?php echo $this->_tpl_vars['search']['server_id']; ?>
"; // 当前选中游戏服务区
var s_sid;

$(document).ready(function(){
    server = eval('('+server+')');
    //alert(server.p_mobile.g_1[0].sever_id);
    //alert(server[platform][gcode][0].server_id]);

	s_platform = document.getElementById("s_platform");//平台
	s_game = document.getElementById("s_game_id");//游戏
	gsname = document.getElementById("s_server_id");//服务器

	if(s_platform.value != ''){
		gsname.options.length = 0;
		gsname.options.add(new Option("<?php echo $this->_tpl_vars['systemLang']['choose']; ?>
",""));

		for (i in server[platform][gcode]){
			var s	=	new Option(server[platform][gcode][i].sever_name,server[platform][gcode][i].sever_id);
			if(server[platform][gcode][i].sever_id == sel_server) s.selected = 'selected';
			gsname.options.add(s);
		}
	}
});

function gameChange(v){
	set_option();
}

function platformChange(v){
	set_option();
}

function set_option(){
	//if(s_platform.value==0) alert("<?php echo $this->_tpl_vars['systemLang']['pleasechoosePlatform']; ?>
");
	//if(s_game.value==0) alert("<?php echo $this->_tpl_vars['systemLang']['pleasechooseGame']; ?>
");

	platform='p_'+s_platform.value;
	gcode='g_'+s_game.value;

	if(s_platform.value != ''){
		gsname.options.length = 0;
		gsname.options.add(new Option("<?php echo $this->_tpl_vars['systemLang']['choose']; ?>
","0"));

		for (i in server[platform][gcode]){
			var s	=	new Option(server[platform][gcode][i].sever_name,server[platform][gcode][i].sever_id);
			gsname.options.add(s);
		}
	}
}

function makeexcel(){
    if(confirm('确认导出excel数据表？')){
        $("#excel").val(1);
	    submitform('<?php echo @BASEURI; ?>
order_right/index/<?php echo $this->_tpl_vars['str']; ?>
',false);
        $("#excel").val(0);
	}
}

</script>

<table width="100%" border="0" class="adminlist" cellspacing="0">
<thead>
<tr>
	<th><?php echo $this->_tpl_vars['systemLang']['currency']; ?>
</th><th><?php echo $this->_tpl_vars['systemLang']['amount_count']; ?>
</th><th><?php echo $this->_tpl_vars['systemLang']['order_count']; ?>
</th>
</tr>
</thead>
<tbody>
<?php $_from = ($this->_tpl_vars['order_total']); if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['vo']):
?>
<tr>
<td><?php echo $this->_tpl_vars['vo']['currency']; ?>
</td>
<td><?php echo $this->_tpl_vars['vo']['amount_count']; ?>
</td>
<td><?php echo $this->_tpl_vars['vo']['order_count']; ?>
</td>
</tr>
<?php endforeach; endif; unset($_from); ?>
<tr>
<td rowspan="3"><?php echo $this->_tpl_vars['systemLang']['pay_user_num']; ?>
:<?php echo $this->_tpl_vars['user_total']; ?>
</td>
</tr>
</tbody>
</table>


<table border="0" class="search" cellspacing="0" id="search">
    <tr>
    	<td>&nbsp;</td>
     	<td>
     	<!--游戏到账时间--><?php echo $this->_tpl_vars['systemLang']['chooseTime']; ?>
:
            <input class="text" style="width:120px" type="text" name="s[order_stime]" id="cctime_s" readonly value="<?php echo $this->_tpl_vars['search']['order_stime']; ?>
"/>
     	<?php echo $this->_tpl_vars['systemLang']['to']; ?>
 <input class="text" style="width:120px" type="text" name="s[order_etime]" id="cctime_e" readonly value="<?php echo $this->_tpl_vars['search']['order_etime']; ?>
"/>&nbsp;&nbsp;

          <?php echo $this->_tpl_vars['systemLang']['inputOrder']; ?>
: <input type="text" name="s[number]" value="<?php echo $this->_tpl_vars['search']['number']; ?>
" /> 
          <?php echo $this->_tpl_vars['systemLang']['inputUserName']; ?>
: <input type="text" name="s[user]" value="<?php echo $this->_tpl_vars['search']['user']; ?>
" />
          <?php echo $this->_tpl_vars['systemLang']['inputUserId']; ?>
: <input type="text" name="s[user_id]" value="<?php echo $this->_tpl_vars['search']['user_id']; ?>
" />
       </td>
    </tr>
    <tr>
    	<td>&nbsp;</td>
    	<td><br/> <?php echo $this->_tpl_vars['systemLang']['chooseGame']; ?>
:            <input type="text" name="country" id="selectGame" value="<?php echo $this->_tpl_vars['games'][$this->_tpl_vars['search']['game_id']]; ?>
" />
            <input type="text" name="s[game_id]" id="gamess" value="<?php echo $this->_tpl_vars['search']['game_id']; ?>
" style="display: none"/>&nbsp;&nbsp;
            <input type="hidden" name="excel" id="excel" value="" />
        <input type="button" class="button" name="ng" onclick="submitform('<?php echo @BASEURI; ?>
order_right/index',false);" value="<?php echo $this->_tpl_vars['systemLang']['watch']; ?>
" />&nbsp;&nbsp;<a href="/order_right/index"><?php echo $this->_tpl_vars['systemLang']['clearSearch']; ?>
</a>
        </td>
    </tr>
</table>
<table width="100%" border="0" class="adminlist" cellspacing="0">

  <thead>
  <tr>
  	<th><?php echo $this->_tpl_vars['systemLang']['time']; ?>
</th>
    <th><?php echo $this->_tpl_vars['systemLang']['orderNo']; ?>
</th>
    <th><?php echo $this->_tpl_vars['systemLang']['userName']; ?>
</th>
    <th><?php echo $this->_tpl_vars['systemLang']['userId']; ?>
</th>
    <th>注册时间</th>
    <th>首冲时间</th>
    <th><?php echo $this->_tpl_vars['systemLang']['chargeAmount']; ?>
</th>
	<!--<th>点数</th>-->
    <th>货币</th>
    <th>from</th>
    <th><?php echo $this->_tpl_vars['systemLang']['chargeGame']; ?>
</th>
    <th><?php echo $this->_tpl_vars['systemLang']['platform']; ?>
</th>
    <th><?php echo $this->_tpl_vars['systemLang']['channel']; ?>
</th>
    <!--<th><?php echo $this->_tpl_vars['systemLang']['gameServer']; ?>
</th>-->
    <th><?php echo $this->_tpl_vars['systemLang']['status']; ?>
</th>
    <th><?php echo $this->_tpl_vars['systemLang']['manuallyModifyTheOrders']; ?>
</th>
    <!--<th>mycard活动</th>-->
  </tr>
  </thead>
  <tbody>
  <?php $_from = $this->_tpl_vars['orders']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['info']):
?>
  <tr class="row0">
  	<td><?php echo ((is_array($_tmp=$this->_tpl_vars['info']['order_submit_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d %H:%M:%S") : smarty_modifier_date_format($_tmp, "%Y-%m-%d %H:%M:%S")); ?>
</td>
   	<td><a href="/order_right/info/<?php echo $this->_tpl_vars['info']['order_number']; ?>
"><?php echo $this->_tpl_vars['info']['order_number']; ?>
</a></td>
    <td><?php echo $this->_tpl_vars['info']['user_name']; ?>
</td>
    <td><?php echo $this->_tpl_vars['info']['user_id']; ?>
</td>
    <td><?php echo ((is_array($_tmp=$this->_tpl_vars['info']['regriter_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d %H:%M:%S") : smarty_modifier_date_format($_tmp, "%Y-%m-%d %H:%M:%S")); ?>
</td>
    <td><?php echo ((is_array($_tmp=$this->_tpl_vars['info']['first_pay_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%Y-%m-%d %H:%M:%S") : smarty_modifier_date_format($_tmp, "%Y-%m-%d %H:%M:%S")); ?>
</td>
    <td><?php echo $this->_tpl_vars['info']['order_amount']; ?>
</td>
	<!--<td><?php echo $this->_tpl_vars['info']['card_point']; ?>
</td>-->
    <td><?php echo $this->_tpl_vars['info']['currency']; ?>
</td>
    <td><?php echo $this->_tpl_vars['info']['fromid']; ?>
</td>
    <td><?php echo $this->_tpl_vars['games'][$this->_tpl_vars['info']['game_id']]; ?>
</td>
    <td><?php echo $this->_tpl_vars['platformList'][$this->_tpl_vars['info']['sfrom']]; ?>
</td> <?php $this->assign('platform_var', $this->_tpl_vars['info']['sfrom']);  $this->assign('game_id_var', $this->_tpl_vars['info']['game_id']);  $this->assign('server_id_var', $this->_tpl_vars['info']['server_id']); ?>
    <!--<td><?php echo $this->_tpl_vars['servers_list'][$this->_tpl_vars['platform_var']][$this->_tpl_vars['game_id_var']][$this->_tpl_vars['server_id_var']]; ?>
</td>-->
    <td><?php echo $this->_tpl_vars['channel'][$this->_tpl_vars['info']['channel_id']]; ?>
</td>
    <td><?php echo $this->_tpl_vars['order_status'][$this->_tpl_vars['info']['order_status']]; ?>
</td>
    <td><?php if ($this->_tpl_vars['info']['operator_id'] > 0): ?>Yes<?php endif; ?></td>
    <!--<td><?php echo $this->_tpl_vars['info']['active_mark']; ?>
&nbsp;</td>-->
  </tr>
  <?php endforeach; endif; unset($_from); ?>
  </tbody>
  <tfoot>
      <tr>
      	<td colspan="10" style="text-align:center"><?php echo $this->_tpl_vars['page']; ?>
</td>
      </tr>
      <tr>
          <td colspan="7"><input type="button" class="button" onclick="makeexcel()" value="导表" /></td>
      </tr>
  </tfoot>
</table>
</form>
<script language="javascript">
    $('#cctime_s').datetimepicker({dateFormat:"yy-mm-dd 00:00:00",timeFormat:"",maxDate:"+1d"});
    $('#cctime_e').datetimepicker({dateFormat:"yy-mm-dd 23:59:59",timeFormat:"",maxDate:"+1d"});

    $("#selectGame").autocomplete("/game_manager/search",{
        max: 10,//显示数据条数
        minChars:1, //在触发autoComplete前用户至少需要输入的字符数 默认为0 在输入框内双击或者删除输入框内内容时显示列表
        matchCase:false,
        matchContains:true,
        //matchContains: "word",//只要包含输入字符就会显示提示
        autoFill:false,//自动填充输入框
        scroll:false,//不显示滚动条
        parse: function(data){
            var rows = [];
            var d = eval(data);
            for(var i=0; i<d.length; i++){
                rows[rows.length] = {
                    data:d[i], //每条数据对象
                    value:d[i].name, //与输入的值比较的数据
                    result:d[i].name  //选中的实际数据
                };
            }
            return rows;
        },
        formatItem: function(row, i, max) {
            console.log(row);
            return   "<span class='ac_name'>"+row.name + "</span>";
        },
        formatMatch: function(row, i, max) {
            return row.name + " " + row.game_id;
        },
        formatResult: function(row) {
            return row.name;
        }
    }).result(function(event, row, formatted) {
        $("#gamess").val(row.game_id);
    });
</script>